import {orderStatus, refundResult, refundStatus} from "@/assets/js/constant";


// 获取订单状态名称  orderStatus
export const getOrderStatusName = (status)=>{
    return  status && (orderStatus.findIndex(c => c.value === status) !== -1) ? orderStatus.filter(c => c.value === status )[0].name : '--'
}

// 获取退款状态名称  orderStatus
export const getRefundStatusName = (status)=>{
    return  status && (refundStatus.findIndex(c => c.value === status) !== -1) ? refundStatus.filter(c => c.value === status )[0].name : '--'
}


// 获取退款状态名称  refundStatus
export const getRefundResultStatusName = (status)=>{
    return  status && (refundResult.findIndex(c => c.value === status) !== -1) ? refundResult.filter(c => c.value === status )[0].name : '--'
}

// 是否在支付状态  orderStatus
export const isPayingState = (status)=>{
    return  status && (orderStatus.findIndex(c => c.value === status) !== -1)
}
// 是否在退款状态  orderStatus
export const isRefundingState = (status)=>{
    return  status && (refundStatus.findIndex(c => c.value === status) !== -1)
}


